/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller.CoreServlet;

import java.io.IOException;
import java.io.PrintWriter;
import javax.jms.Session;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import Model.ObjectBean.RequestBean.*;
import Model.ObjectBean.ViewBean.*;
/**
 *
 * @author chickencake1
 * Function : Make an action when user logout website
 * 1. leave page
 * 2. close browser
 * 3.
 */
public class logoutServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //request.getSession().invalidate();

        
        LoginStatus status = (LoginStatus) request.getSession().getAttribute("status");
        status.setStatus("start");
        RequestDispatcher dispatcher= request.getRequestDispatcher("/WEB-INF/MainJSP/LoginPage.jsp");
        dispatcher.forward(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
    

    
}
